package com.wqr.it.ecwdr;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Hello world!
 *
 */
@SpringBootApplication
@EnableCaching
@RestController
@EnableScheduling
@ServletComponentScan
@EnableTransactionManagement
public class ECWDRServerApp {

	@Bean
	public Object testBean(PlatformTransactionManager platformTransactionManager) {
		System.out.println(">>>>>>>>>>" + platformTransactionManager.getClass().getName());
		return new Object();
	}

	private static final Logger logger = LoggerFactory.getLogger("INFO");

	@RequestMapping("/")
	public String greeting() {
		return "Hello World!";
	}

	public static void main(String[] args) {
		System.out.println("Hello ECWDR Server!");
		SpringApplication.run(ECWDRServerApp.class, args);
		logger.info("Init completed!");
	}
}
